1. Field of the Invention
The present invention relates to an image processing apparatus, image processing method, and recording medium whereby a halftone image after halftone processing is restored to a multilevel image prior to halftone processing.
2. Description of the Related Art
An electrophotographic method is known as an image recording method used in an image processing apparatus such as a printer or a copy machine. In this electrophotographic method, a latent image is formed on a photosensitive drum using a laser beam, and developed by a charged color material (below, referred to as toner). Image recording is performed by transferring the developed image formed with toner to a transfer paper and fixing the image on the transfer paper.
Multi-tone image data that includes halftones is conceivable as the output image at that time, and in the above electrophotographic method, because a halftone image is difficult to obtain, it is ordinarily necessary to generate an image with a quasi-halftone method, and halftone processing as conversion processing in that method is necessary.
Here, a specific example of halftone processing is shown in FIGS. 3A to 3C. FIGS. 3A to 3C show principles of image 2-level conversion by a dithering technique for a two tone printer. First, an input multilevel image 301 (for example, an 8-bit tone image) is divided into N×M (in FIGS. 3A to 3C, 8×8) blocks. Then, the size of tone values of pixels within the blocks is compared with an N×M dither threshold matrix 302 of the same size. Black is output if the pixel value is larger than that threshold, and white is output in the case of other pixel values. By performing this processing for all pixels in each size of matrix, a 2-level-converted image 303 in which the entire image has been converted to two levels is obtained.
In FIGS. 3A to 3C, 2-level conversion by two tones (1-bit depth) is described, but by using a 2-bit or 4-bit dithering bit depth, it is possible to convert the entire image to four levels or 16 levels. When a 2-bit bit depth is used, three instances of the dither threshold are present, and a darker dot is output when the pixel value exceeds each threshold. When a 4-bit bit depth is used, 15 instances of the dither threshold are present. In either case, when a pixel value has exceeded all of the thresholds (three instances in the case of two bits, and 15 instances in the case of four bits), a point with the same maximum darkness as black is output with the two tone printer.
Ordinarily, when storing an image after halftone processing in a storage device, in the case of a color image, often the image is recorded in four colors: cyan, magenta, yellow, and black (referred to below as CMYK). In the case of a monochrome image, often the image is recorded in one color: black (referred to below as K). When using a halftone image that has been recorded in this manner in another printer or a personal computer (PC), problems as described below may occur.
For example, when a halftone image is sent to a PC via a network, because there are few applications that can handle a CMYK image on PCs, it is difficult to use a halftone image as-is on that PC.
When a halftone image is sent to another image output apparatus via a network, because the output characteristics are different for each apparatus, there may be instances where output cannot be performed so as to be certain of having optimal image quality with that image output apparatus, so image quality markedly deteriorates. For example, dither processing ordinarily used as halftone processing has a periodic nature, so when an image on which dither processing has been performed with a particular apparatus is output with another apparatus that has a different number of lines and angle of dither, often interference will occur between dithers and be visible as moiré, and thus the degree of deterioration becomes even more marked.
In order to avoid these problems, it is necessary to restore the halftone image to a multilevel image prior to halftone processing, to the extent possible. Therefore, a technique of restoring a multilevel image based on a dither threshold matrix has been proposed (for example, see Japanese Patent Laid-Open No. 2005-252701). According to this technique, by comparing the pixel values of a dither threshold matrix and a halftone image, a multilevel image prior to halftone processing is restored. With respect to a pixel that could not be restored by comparison with the dither threshold matrix, the value of that pixel is determined based on the value of an adjacent pixel that could be restored, and specifically, is set to the same value as the adjacent pixel.
However, according to the above conventional method for restoring image data prior to halftone processing, there are the following problems.
Specifically, when there are many pixels that could not be restored within the dither threshold matrix, because there are many estimated values as pixel values after restoration, often there are many errors in the image as a whole. Also, because a pixel that could not be restored is restored to the same value as an adjacent pixel, there may be a marked reduction in the sharpness of the restored image as a whole.
Also, because it is necessary to use a line buffer corresponding to the height (size of sub-scanning direction) of the dither threshold matrix, a large memory capacity is made necessary, depending on the size of the dither threshold matrix and the size of the image as a whole.